var logineent = function(){
    var postdata = {
        loginid: $('#adminlist').val(),
        adminpwd:$('#adminpwd').val()
    };
    if(postdata.loginid==0 || !postdata.adminpwd){
        $.Dialog.fail("登录信息输入不完整！");
        return false;
    }
    else{
        $.Dialog.loading();
        $.ajax({
            url: adminlogin.admintologin,
            type:"post",
            data:postdata,
            dataType:"json",
            success:function(data){
                switch (data.statu){
                    case 0:
                        $.Dialog.success(data.content);
                        setTimeout(function(){
                            location.href = adminlogin.showproduct;
                        },2000);
                        break;
                    case 1:
                        $.Dialog.fail(data.content);
                        break;
                }
            }
        });
    }
};
$('#submit').click(function(){
    logineent();
});
$(document).keypress(function(e) {
    // 回车键事件
    if(e.which == 13) {
        logineent();
    }
});